<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-utils/glBuffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('glBuffer_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">glBuffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="glBuffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * to deal in the Software without restriction, including without limitation</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Software is furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * all copies or substantial portions of the Software.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DEALINGS IN THE SOFTWARE.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __GL_BUFFER_H__</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __GL_BUFFER_H__</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cudaUtility_8h.html">cudaUtility.h</a>&quot;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;cuda_gl_interop.h&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga0bd307cace43e530c0595a5f175bbee5">   35</a></span>&#160;<span class="preprocessor">#define GL_VERTEX_BUFFER        GL_ARRAY_BUFFER</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="group__OpenGL.html#gaa8030c5f4c6c173efeb78dbf732bd72c">   41</a></span>&#160;<span class="preprocessor">#define GL_INDEX_BUFFER                 GL_ELEMENT_ARRAY_BUFFER</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga35178b75efe97d52bb130b75e1ddd5f3">   47</a></span>&#160;<span class="preprocessor">#define GL_MAP_CPU                      0x1</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga3ca90a8f0970ac09dcd34cf9908cbeee">   53</a></span>&#160;<span class="preprocessor">#define GL_MAP_CUDA             0x2</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga83b36ae7f5be085cfb52c24a8def5457">   59</a></span>&#160;<span class="preprocessor">#define GL_FROM_CPU                     0x3</span></div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="group__OpenGL.html#gaedd033c4196021ff338e5e123d7c193f">   65</a></span>&#160;<span class="preprocessor">#define GL_FROM_CUDA            0x4</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga1a91d7f7cdf8b17bbc503ef86e9de6a6">   71</a></span>&#160;<span class="preprocessor">#define GL_TO_CPU                       0x5</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga72987ef9b0b241cddbdca6da7d71dadf">   77</a></span>&#160;<span class="preprocessor">#define GL_TO_CUDA                      0x6</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="group__OpenGL.html#ga0eda41e13107c1422939c363e9596797">   83</a></span>&#160;<span class="preprocessor">#define GL_WRITE_DISCARD        (GL_READ_WRITE + 0xff) </span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">#ifndef GL_WRITE_ONLY</span></div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="group__OpenGL.html#gab43997c5949dffce6674a7bb8a3059da">   90</a></span>&#160;<span class="preprocessor">#define GL_WRITE_ONLY           GL_WRITE_ONLY_ARB</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;<span class="preprocessor">#ifndef GL_READ_ONLY</span></div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="group__OpenGL.html#gafe26dad29b9cb2620e815e5fecea71f9">   98</a></span>&#160;<span class="preprocessor">#define GL_READ_ONLY            GL_READ_ONLY_ARB</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="preprocessor">#ifndef GL_READ_WRITE</span></div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="group__OpenGL.html#gaa5fd429fd2b79f5936c1421afb205dcd">  106</a></span>&#160;<span class="preprocessor">#define GL_READ_WRITE           GL_READ_WRITE_ARB</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classglBuffer.html">  114</a></span>&#160;<span class="keyword">class </span><a class="code" href="classglBuffer.html">glBuffer</a></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;{</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="keyword">static</span> <a class="code" href="classglBuffer.html">glBuffer</a>* <a class="code" href="classglBuffer.html#a17734482bf95e1d85c80e92072e6ac5b">Create</a>( uint32_t type, uint32_t size, <span class="keywordtype">void</span>* data=NULL, uint32_t usage=GL_STATIC_DRAW );</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        </div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keyword">static</span> <a class="code" href="classglBuffer.html">glBuffer</a>* <a class="code" href="classglBuffer.html#a17734482bf95e1d85c80e92072e6ac5b">Create</a>( uint32_t type, uint32_t numElements, uint32_t elementSize, <span class="keywordtype">void</span>* data=NULL, uint32_t usage=GL_STATIC_DRAW );</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;        </div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <a class="code" href="classglBuffer.html#aa68c3df899e3305236c694d43fba29eb">~glBuffer</a>();</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classglBuffer.html#a4f5e860c31aba728e5e52826f09ecb5f">Bind</a>();</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classglBuffer.html#a42211a6a486c9334d8796684803ce5aa">Unbind</a>();</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        </div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classglBuffer.html#abfb2d3283887fe3cc4a58ee08b544251">  154</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classglBuffer.html#abfb2d3283887fe3cc4a58ee08b544251">GetID</a>()<span class="keyword"> const                   </span>{ <span class="keywordflow">return</span> mID; }</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classglBuffer.html#a86ea0513d06cab3172bc6c82c1a9c024">  159</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classglBuffer.html#a86ea0513d06cab3172bc6c82c1a9c024">GetType</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> mType; }</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf">  164</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf">GetSize</a>()<span class="keyword"> const         </span>{ <span class="keywordflow">return</span> mSize; }</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classglBuffer.html#a3a85731d95935b4da3725caa5853974e">  172</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classglBuffer.html#a3a85731d95935b4da3725caa5853974e">GetNumElements</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> mNumElements; }</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classglBuffer.html#a27fac07e59d2f4acb149c80e71124b7d">  180</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classglBuffer.html#a27fac07e59d2f4acb149c80e71124b7d">GetElementSize</a>()<span class="keyword"> const  </span>{ <span class="keywordflow">return</span> mElementSize; }</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <span class="keywordtype">void</span>* <a class="code" href="classglBuffer.html#a6be33e8d39823bc9e231c4c6eacdff5d">Map</a>( uint32_t device, uint32_t flags );</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="classglBuffer.html#a9eb0b82989ca01d884dd2d5bed3d5d44">Unmap</a>();</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classglBuffer.html#ad1c90d9ff6bf53e29ea72c721f8e36dc">Copy</a>( <span class="keywordtype">void</span>* ptr, uint32_t flags );</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classglBuffer.html#ad1c90d9ff6bf53e29ea72c721f8e36dc">Copy</a>( <span class="keywordtype">void</span>* ptr, uint32_t size, uint32_t flags );</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classglBuffer.html#ad1c90d9ff6bf53e29ea72c721f8e36dc">Copy</a>( <span class="keywordtype">void</span>* ptr, uint32_t offset, uint32_t size, uint32_t flags );</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        <a class="code" href="classglBuffer.html">glBuffer</a>();</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        <span class="keywordtype">bool</span> init( uint32_t type, uint32_t size, <span class="keywordtype">void</span>* data, uint32_t usage);</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        </div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        uint32_t mID;</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;        uint32_t mSize;</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;        uint32_t mType;</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        uint32_t mUsage;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        uint32_t mNumElements;</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;        uint32_t mElementSize;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;        uint32_t mMapDevice;</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        uint32_t mMapFlags;</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;        cudaGraphicsResource* mInteropCUDA;</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;};</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="classglBuffer_html_a6be33e8d39823bc9e231c4c6eacdff5d"><div class="ttname"><a href="classglBuffer.html#a6be33e8d39823bc9e231c4c6eacdff5d">glBuffer::Map</a></div><div class="ttdeci">void * Map(uint32_t device, uint32_t flags)</div><div class="ttdoc">Map the buffer for accessing from the CPU or CUDA. </div></div>
<div class="ttc" id="classglBuffer_html_abfb2d3283887fe3cc4a58ee08b544251"><div class="ttname"><a href="classglBuffer.html#abfb2d3283887fe3cc4a58ee08b544251">glBuffer::GetID</a></div><div class="ttdeci">uint32_t GetID() const</div><div class="ttdoc">Retrieve the OpenGL resource handle of the buffer. </div><div class="ttdef"><b>Definition:</b> glBuffer.h:154</div></div>
<div class="ttc" id="classglBuffer_html_a27fac07e59d2f4acb149c80e71124b7d"><div class="ttname"><a href="classglBuffer.html#a27fac07e59d2f4acb149c80e71124b7d">glBuffer::GetElementSize</a></div><div class="ttdeci">uint32_t GetElementSize() const</div><div class="ttdoc">Retrieve the size in bytes of each element. </div><div class="ttdef"><b>Definition:</b> glBuffer.h:180</div></div>
<div class="ttc" id="classglBuffer_html_a86ea0513d06cab3172bc6c82c1a9c024"><div class="ttname"><a href="classglBuffer.html#a86ea0513d06cab3172bc6c82c1a9c024">glBuffer::GetType</a></div><div class="ttdeci">uint32_t GetType() const</div><div class="ttdoc">Retrieve the buffer type (GL_VERTEX_BUFFER or GL_INDEX_BUFFER) </div><div class="ttdef"><b>Definition:</b> glBuffer.h:159</div></div>
<div class="ttc" id="classglBuffer_html_a3a85731d95935b4da3725caa5853974e"><div class="ttname"><a href="classglBuffer.html#a3a85731d95935b4da3725caa5853974e">glBuffer::GetNumElements</a></div><div class="ttdeci">uint32_t GetNumElements() const</div><div class="ttdoc">Retrieve the number of elements (i.e. </div><div class="ttdef"><b>Definition:</b> glBuffer.h:172</div></div>
<div class="ttc" id="classglBuffer_html_a4f5e860c31aba728e5e52826f09ecb5f"><div class="ttname"><a href="classglBuffer.html#a4f5e860c31aba728e5e52826f09ecb5f">glBuffer::Bind</a></div><div class="ttdeci">bool Bind()</div><div class="ttdoc">Activate using the buffer. </div></div>
<div class="ttc" id="classglBuffer_html_aa68c3df899e3305236c694d43fba29eb"><div class="ttname"><a href="classglBuffer.html#aa68c3df899e3305236c694d43fba29eb">glBuffer::~glBuffer</a></div><div class="ttdeci">~glBuffer()</div><div class="ttdoc">Free the buffer. </div></div>
<div class="ttc" id="classglBuffer_html_a580879d597540e6775457f1fd2a5eaaf"><div class="ttname"><a href="classglBuffer.html#a580879d597540e6775457f1fd2a5eaaf">glBuffer::GetSize</a></div><div class="ttdeci">uint32_t GetSize() const</div><div class="ttdoc">Retrieve the total size in bytes of the buffer. </div><div class="ttdef"><b>Definition:</b> glBuffer.h:164</div></div>
<div class="ttc" id="classglBuffer_html_a9eb0b82989ca01d884dd2d5bed3d5d44"><div class="ttname"><a href="classglBuffer.html#a9eb0b82989ca01d884dd2d5bed3d5d44">glBuffer::Unmap</a></div><div class="ttdeci">void Unmap()</div><div class="ttdoc">Unmap the buffer from CPU/CUDA access. </div></div>
<div class="ttc" id="classglBuffer_html_ad1c90d9ff6bf53e29ea72c721f8e36dc"><div class="ttname"><a href="classglBuffer.html#ad1c90d9ff6bf53e29ea72c721f8e36dc">glBuffer::Copy</a></div><div class="ttdeci">bool Copy(void *ptr, uint32_t flags)</div><div class="ttdoc">Copy entire contents of the buffer to/from CPU or CUDA memory. </div></div>
<div class="ttc" id="classglBuffer_html"><div class="ttname"><a href="classglBuffer.html">glBuffer</a></div><div class="ttdoc">OpenGL buffer with CUDA interoperability. </div><div class="ttdef"><b>Definition:</b> glBuffer.h:114</div></div>
<div class="ttc" id="classglBuffer_html_a17734482bf95e1d85c80e92072e6ac5b"><div class="ttname"><a href="classglBuffer.html#a17734482bf95e1d85c80e92072e6ac5b">glBuffer::Create</a></div><div class="ttdeci">static glBuffer * Create(uint32_t type, uint32_t size, void *data=NULL, uint32_t usage=GL_STATIC_DRAW)</div><div class="ttdoc">Allocate an OpenGL buffer. </div></div>
<div class="ttc" id="classglBuffer_html_a42211a6a486c9334d8796684803ce5aa"><div class="ttname"><a href="classglBuffer.html#a42211a6a486c9334d8796684803ce5aa">glBuffer::Unbind</a></div><div class="ttdeci">void Unbind()</div><div class="ttdoc">Deactivate using the buffer. </div></div>
<div class="ttc" id="cudaUtility_8h_html"><div class="ttname"><a href="cudaUtility_8h.html">cudaUtility.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_54a0acf6da04fe2ed9410b4c6369bc5d.html">jetson-utils</a></li><li class="navelem"><a class="el" href="glBuffer_8h.html">glBuffer.h</a></li>
    <li class="footer">Generated on Tue Jul 14 2020 21:59:33 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
